//modified from SeeedOLED library for compatibility
//Petoi LLC

#include <Wire.h>
#include "SSD1315.h"
#include <avr/pgmspace.h>

static const unsigned char PetoiLogo1[] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, \
  0x1f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7f, 0x7f, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0x3f, 0x3f, \
  0x3f, 0x3f, 0x1f, 0x1f, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \
  0x00, 0x00, 0xfe, 0xfe, 0xfc, 0xfc, 0xf8, 0xf8, \
  0xf0, 0x61, 0x43, 0x03, 0x07, 0x1f, 0x1f, 0x1f, \
  0x1f, 0x1f, 0x1f, 0x1f, 0x0f, 0x0f, 0x0f, 0x1f, \
  0x0f, 0x0f, 0x0f, 0x0f, 0x8f, 0x87, 0x87, 0xc3, \
  0xc3, 0xe1, 0xf0, 0xf8, 0xf8, 0xfc, 0xdc, 0x9e, \
  0x0e, 0x0e, 0x0e, 0x0e, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, \
  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \
  0x00, 0x00, 0x07, 0x87, 0xc3, 0xe3, 0x61, 0x70, \
  0x38, 0x38, 0x3c, 0x3c, 0x3e, 0x3e, 0x7e, 0x7f, \
  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x3f, 0x3f, \
  0x3f, 0x3f, 0x3f, 0x3f, 0x7f, 0xff, 0xff, 0xff, \
  0xff, 0x3e, 0x1e, 0x3c, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, \
  0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0x78, 0x70, 0x00, \
  0x00, 0x01, 0x87, 0xff, 0xff, 0x7f, 0x3f, 0x1f, \
  0x1f, 0x8f, 0x8f, 0x8f, 0x8f, 0x1f, 0x1f, 0x3f, \
  0x7f, 0xff, 0xff, 0x9f, 0x8f, 0x00, 0x00, 0x00, \
  0x0f, 0x9f, 0x9f, 0xff, 0xff, 0xff, 0x3f, 0x1f, \
  0x1f, 0x1f, 0x8f, 0x8f, 0x8f, 0x0f, 0x1f, 0x1f, \
  0x3f, 0x7f, 0xff, 0xff, 0xff, 0x1c, 0x08, 0x08, \
  0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \
  0x00, 0x00, 0x7c, 0xff, 0x83, 0x00, 0x00, 0x38, \
  0x7c, 0xc6, 0x82, 0x82, 0xc6, 0xc4, 0xc0, 0xc0, \
  0xc0, 0xc3, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, \
  0xff, 0xc7, 0x01, 0x00, 0x10, 0x7c, 0xc6, 0x82, \
  0x82, 0xc6, 0x6e, 0x38, 0x00, 0x00, 0x83, 0xff, \
  0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
  0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfc, \
  0xfc, 0xfe, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, \
  0x73, 0xf3, 0xf3, 0xf3, 0xf3, 0x72, 0x30, 0x30, \
  0x30, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, \
  0x7f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, \
  0x1c, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0x3e, 0x00, \
  0x00, 0x00, 0xe1, 0xff, 0xff, 0x00, 0x00, 0x00, \
  0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, \
  0xf8, 0xf0, 0xe0, 0xc1, 0x87, 0x8f, 0x0c, 0x1c, \
  0x38, 0x38, 0x78, 0x78, 0xf8, 0xf8, 0xfc, 0xfc, \
  0xff, 0xff, 0xff, 0xf3, 0x60, 0x00, 0x00, 0xf1, \
  0xfb, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xf8, 0x78, \
  0x78, 0x38, 0x38, 0x18, 0x0c, 0x0e, 0x87, 0xc3, \
  0xe0, 0xf0, 0xf8, 0xfc, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xfc, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, \
  0xfc, 0xfc, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfe, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xfc, \
  0xf8, 0xf8, 0xfc, 0xfc, 0xff, 0xff, 0xfe, 0xfe, \
  0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, \
  0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, \
  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, \
  0xfe, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf1, \
  0xf1, 0xf1, 0xf1, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, \
  0xf1, 0xf1, 0xf1, 0xf1, 0xf0, 0xf8, 0xf8, 0xf8, \
  0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

static const unsigned char PetoiLogo2[] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, \
  0x3f, 0x1f, 0x1f, 0x0f, 0x8f, 0x87, 0xc7, 0xc7, \
  0xc3, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xfb, 0x01, 0x01, 0x01, \
  0xe1, 0xe3, 0xe3, 0xe3, 0xe3, 0xc3, 0xc7, 0x87, \
  0x0f, 0x1f, 0x1f, 0x3f, 0x7f, 0x7f, 0x3f, 0x3f, \
  0x3f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f, \
  0x8f, 0x8f, 0x87, 0xc7, 0xc3, 0xe1, 0xe0, 0xf0, \
  0xf8, 0xfc, 0xfe, 0xff, 0xf7, 0xe3, 0xe3, 0xe1, \
  0xc1, 0x81, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, \
  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, \
  0x01, 0x3f, 0x7f, 0x3f, 0x1f, 0x0f, 0x87, 0xc3, \
  0xe3, 0xe0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, \
  0xfe, 0xfe, 0xfe, 0xf0, 0x00, 0x00, 0x07, 0xff, \
  0xff, 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x1f, 0x0f, \
  0x8f, 0x8f, 0x0f, 0x1f, 0x1f, 0x3f, 0x7f, 0xff, \
  0xff, 0x03, 0x07, 0x0f, 0x7f, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, \
  0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0x78, 0x70, 0x00, \
  0x00, 0x01, 0x87, 0xff, 0xff, 0x7f, 0x3f, 0x1f, \
  0x1f, 0x8f, 0x8f, 0x8f, 0x8f, 0x1f, 0x1f, 0x3f, \
  0x7f, 0xff, 0xff, 0x9f, 0x8f, 0x00, 0x00, 0x00, \
  0x0f, 0x9f, 0x9f, 0xff, 0xff, 0xff, 0x3f, 0x1f, \
  0x1f, 0x1f, 0x8f, 0x8f, 0x8f, 0x0f, 0x1f, 0x1f, \
  0x3f, 0x7f, 0xff, 0xff, 0xff, 0x1c, 0x08, 0x08, \
  0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, \
  0x00, 0x00, 0x00, 0xf8, 0xfe, 0x1f, 0x07, 0x03, \
  0xe3, 0xf1, 0x11, 0x19, 0x19, 0x11, 0x91, 0x81, \
  0x83, 0x87, 0xdf, 0xff, 0xfc, 0x00, 0x00, 0x01, \
  0xff, 0xff, 0xc0, 0x80, 0x00, 0x1e, 0x3f, 0x61, \
  0x61, 0x61, 0x21, 0x3f, 0x0c, 0x00, 0x80, 0xe1, \
  0xff, 0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
  0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfc, \
  0xfc, 0xfe, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, \
  0x73, 0xf3, 0xf3, 0xf3, 0xf3, 0x72, 0x30, 0x30, \
  0x30, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, \
  0x7f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, \
  0x1c, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0x3e, 0x00, \
  0x00, 0x00, 0xe1, 0xff, 0xff, 0x00, 0x00, 0x00, \
  0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xf0, 0xc0, 0x80, 0x83, 0x0f, 0x1e, 0x3c, 0x38, \
  0x78, 0x71, 0xf1, 0xf3, 0xf1, 0xf1, 0xf9, 0xf9, \
  0xfd, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xe0, 0x00, \
  0x00, 0x71, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0x7c, \
  0x7c, 0x3c, 0x1c, 0x1e, 0x0e, 0x87, 0xc3, 0xc1, \
  0xe0, 0xf0, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xfc, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, \
  0xfc, 0xfc, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfe, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xfc, \
  0xf8, 0xf8, 0xfc, 0xfc, 0xff, 0xff, 0xff, 0xfe, \
  0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, \
  0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, \
  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfc, \
  0xfc, 0xf8, 0xf8, 0xf8, 0xf1, 0xf1, 0xf1, 0xf1, \
  0xe1, 0xe3, 0xe3, 0xe3, 0xe3, 0xe1, 0xe0, 0xe0, \
  0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, \
  0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

void setup() {
  Wire.begin();
  SeeedOled.init();  //initialze SEEED OLED display
}

void setDisplayToOriginalState(char testCase)

{
  delay(2000);
  SeeedOled.init();                       //initialze SEEED OLED display
  SeeedOled.clearDisplay();               // clear the screen and set start position to top left corner
  SeeedOled.deactivateScroll();           // deactivete Scroll (might be activated by previous test case)
  SeeedOled.setNormalDisplay();           // Non-inverted Display
  SeeedOled.setPageMode();                // Page mode to start with
  for (byte p = 2; p < 6; p++) {
    SeeedOled.setTextXY(p, 0);              // 0 Page, 0th Column
    SeeedOled.putString("Test Case ");
    SeeedOled.putNumber(testCase);
  }
  delay(400);
}


void loop() {
  setDisplayToOriginalState(1);
  SeeedOled.clearDisplay();               // clear the screen and set start position to top left corner

  for (int b = 0; b < 3; b++) {
    SeeedOled.setNormalDisplay();       //Set display to Normal mode
    SeeedOled.drawBitmap((unsigned char*) PetoiLogo1, 1024);  // 1024 = 128 Pixels * 64 Pixels / 8
    delay(100);
    SeeedOled.setInverseDisplay();          // Set Display to inverse mode
    SeeedOled.drawBitmap((unsigned char*) PetoiLogo2, 1024);  // 1024 = 128 Pixels * 64 Pixels / 8
    delay(100);
  }

  setDisplayToOriginalState(2);
  SeeedOled.clearDisplay();               // clear the screen and set start position to top left corner
  SeeedOled.drawBitmap((unsigned char*) PetoiLogo1, 1024);  // 1024 = 128 Pixels * 64 Pixels / 8
  //SeeedOled.setPageMode();           //Set addressing mode to Page Mode
  SeeedOled.setTextXY(6, 0);         //Set the cursor to Xth Page, Yth Column
  SeeedOled.putString("Hello World!    "); //Print the String

  SeeedOled.setHorizontalScrollProperties(Scroll_Left, 6, 7, Scroll_2Frames); //Set Scrolling properties to Scroll Left
  SeeedOled.activateScroll();             // Activate Scrolling
  delay(1000);

  setDisplayToOriginalState(3);
  SeeedOled.clearDisplay();               // clear the screen and set start position to top left corner
  SeeedOled.drawBitmap((unsigned char*) PetoiLogo1, 1024);  // 1024 = 128 Pixels * 64 Pixels / 8
  SeeedOled.setHorizontalScrollProperties(Scroll_Right, 0, 7, Scroll_2Frames); //Set the properties of Horizontal Scrool
  SeeedOled.activateScroll();             // Activate Scroll
  delay(1000);

  setDisplayToOriginalState(4);
  SeeedOled.clearDisplay();          //clear the screen and set start position to top left corner
  SeeedOled.setNormalDisplay();      //Set display to normal mode (i.e non-inverse mode)
  SeeedOled.setPageMode();           //Set addressing mode to Page Mode
  SeeedOled.setTextXY(1, 0);         //Set the cursor to Xth Page, Yth Column
  SeeedOled.putString("ryone!          Robotics for Eve"); //Print the String. notice how a long sentence is splitted

  setDisplayToOriginalState(5);
  SeeedOled.clearDisplay();           //clear the screen and set start position to top left corner
  SeeedOled.setNormalDisplay();       //Set display to Normal mode
  SeeedOled.setPageMode();            //Set addressing mode to Page Mode
  SeeedOled.setTextXY(2, 5);          //Set the cursor to 2th Page, 5th Column
  SeeedOled.putNumber(123);           //Print number
  SeeedOled.setTextXY(3, 5);          //Set the cursor to 3st Page, 5th Column
  SeeedOled.putNumber(0xFFFF);        //Print number
  SeeedOled.setTextXY(4, 5);          //Set the cursor to 4nd Page, 5th Column
  SeeedOled.putNumber(0xFFFFFFFF);    //Print number
  SeeedOled.setTextXY(5, 5);          //Set the cursor to 5rd Page, 5th Column
  SeeedOled.putNumber(-12345);        //Print number


  setDisplayToOriginalState(6);
  SeeedOled.clearDisplay();           //clear the screen and set start position to top left corner
  SeeedOled.setInverseDisplay();          // Set Display to inverse mode
  SeeedOled.setHorizontalMode();      //Set addressing mode to Horizontal Mode
  SeeedOled.setBrightness(0);
  SeeedOled.putString("!\"#$%&'() * +, -. / 0123456789:; <= >? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{ | }~");  //Print String (ASCII 32 - 126 )
  SeeedOled.setTextXY(7, 2);         //Set the cursor to Xth Page, Yth Column
  SeeedOled.putString("Brightness: "); //Print the String
  for (unsigned char brightness = 0; brightness < 255; brightness += 1) {
    SeeedOled.setBrightness(brightness);
    SeeedOled.setTextXY(7, 13);             // Set the Cursor position to 7th Page , 13th Column
    SeeedOled.putNumber(brightness);
    delay(brightness>50?5:20);                              // Delay between different brightness number
  }
}
